//package com.ruyuan.eshop.construction.dao;
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.ruyuan.eshop.common.dao.BaseDAO;
//import com.ruyuan.eshop.construction.builder.FullDraftData;
//import com.ruyuan.eshop.construction.converter.DraftConverter;
//import com.ruyuan.eshop.construction.domain.dto.DraftImgDTO;
//import com.ruyuan.eshop.construction.domain.dto.DraftMainDTO;
//import com.ruyuan.eshop.construction.domain.entity.DraftImgDO;
//import com.ruyuan.eshop.construction.mapper.DraftImgMapper;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Repository;
//import org.springframework.util.CollectionUtils;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// * 草稿图片
// *
// * @author zhonghuashishan
// */
//@Repository
//@Slf4j
//public class DraftImgDAO extends BaseDAO<DraftImgMapper, DraftImgDO> {
//
//    @Resource
//    private DraftConverter draftConverter;
//
//    public List<DraftImgDTO> getByDraft(DraftMainDTO draftMainDTO) {
//        LambdaQueryWrapper<DraftImgDO> queryWrapper = Wrappers.lambdaQuery();
//        queryWrapper.eq(DraftImgDO::getDraftId, draftMainDTO.getId());
//        return draftConverter.convertImgDTO(this.list(queryWrapper));
//    }
//
//    public void saveDraftImgBatch(FullDraftData fullDraftData) {
//        List<DraftImgDO> draftImgDOS = fullDraftData.getDraftImgDOS();
//        if (!CollectionUtils.isEmpty(draftImgDOS)){
//            for (DraftImgDO draftImgDO : draftImgDOS) {
//                draftImgDO.setDraftId(fullDraftData.getDraftMainDO().getId());
//            }
//            this.saveBatch(draftImgDOS);
//        }
//    }
//}
